<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page import="com.esurvey.core.*" %>
<%@ page import="java.sql.Date" %>
<HTML>
<HEAD>
	<TITLE>eSurvey - Confirmaci&oacute;n de eliminaci&oacute;n de usuario</TITLE>
	<LINK href="styles/general.css" type="text/css" rel="stylesheet">
	<SCRIPT src="jquery/jquery.js" type="text/javascript"></SCRIPT>
	<SCRIPT src="js/global.js" type="text/javascript"></SCRIPT>
</HEAD>
<STYLE>
	div#main {
		margin-left: 30px;
	}
</STYLE>
<%
if ((session.getAttribute("kind") == "admin") && (request.getParameter("idUser") != null)) {
	try {
		int idUserSelec = Integer.parseInt((String) request.getParameter("idUser"));
		int cont = eSurveyPersistence.deleteUser(idUserSelec);
		//comprobamos que el usuario se ha eliminado correctamente
		if (cont != 0) {
%>
<BODY>
<DIV id="general">
	<DIV id="header">
		<%@ include file="header.jsp" %>
	</DIV>
	<DIV id="content">
		<DIV id="main">
			<H1>El usuario ha sido eliminado correctamente</H1>
			<P>Puedes volver al men&uacute; principal <A href="adminUsers.jsp">pulsando aqu&iacute;</A></P>
		</DIV>
		<DIV id="nav">
			<DIV class="tabs">
				<%@ include file="adminTabs.html" %>
			</DIV>
		</DIV>
	</DIV>
	<DIV id="footer">
		<%@ include file="footer.jsp" %>
	</DIV>
</DIV>
</BODY>
<%
		} else {
			response.sendRedirect("login.jsp");
		}
	} catch (Exception e) {
		response.sendRedirect("error.jsp?exception="+e);
	}
} else {
		response.sendRedirect("login.jsp");
}
%>
</HTML>
